package com.javasea.spring.proxy.cglibproxy2;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {

    /**
     * 要求传入一个IPrint参数，Spring会从容器中找到一个bean做为参数传入，
     * 而这个bean就是咱们生成的代理类，这样才能够根据不一样的参数来选中具体的实现类
     * @param printProxy
     */
    public Application(IPrint printProxy) {
        printProxy.execute(10, " log print ");
        printProxy.execute(0, " console print ");
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
